/*
 * c7_exercise1.cpp
 *
 *  Created on: Sep 1, 2013
 *      Author: cyper.yin
 */

#include <iostream>
using namespace std;

double calc_harmonic(double x, double y);

int main_c7e1(int argc, char **argv) {
	cout << "Enter a pair of numbers(x y):";

	double x, y;
	while (cin >> x >> y) {
		if (x == 0 || y == 0) {
			cout << "Terminated." << endl;
			break;
		}
		cout << "you get: " << calc_harmonic(x, y) << endl;

		cout << "Enter a pair of numbers(x y):";
	}

	return 0;
}

double calc_harmonic(double x, double y) {
	return 2.0 * x * y / (x + y);
}

